﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SEVN.Web.Framework.Modules.News
{
    public partial class New0201 : System.Web.UI.UserControl
    {
        WebFrameDataContext web = new WebFrameDataContext();
        protected void Page_Load(object sender, EventArgs e)
        {
            // Load Tin mới
            RptNews.DataSource = web.Newsletters.Where(x => x.CreateDate <= DateTime.Now.AddMonths(-1)).OrderByDescending(x => x.CreateDate).Take(4);
            RptNews.DataBind();
            // Load Tiêu điểm
            rptSpecial.DataSource = web.Newsletters.Where(x => x.CreateDate <= DateTime.Now.AddMonths(-1)).OrderByDescending(x => x.HitCount).Take(4);
            rptSpecial.DataBind();
        }
    }
}